package com.tanhua.server.service;

import com.tanhua.model.domain.User;
import com.tanhua.model.vo.HuanXinUserVo;
import com.tanhua.server.interceptor.UserHolder;
import com.tanhua.service.UserApi;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

/**
 * @author げっしょく
 * @date 2021/10/29
 */
@Service
public class HuanxinService {

    @DubboReference
    private UserApi userApi;

    //通过用户查询环信账号密码
    public HuanXinUserVo getUser() {
        User user = userApi.getByID(UserHolder.getId());

        HuanXinUserVo vo = new HuanXinUserVo(user.getHxUser(), user.getHxPassword());

        return vo;
    }
}
